Skip to content

fix: report tech-debt changes by data-row content, not line count#45

Open
kim-em wants to merge 1 commit into
masterfrom
fix-techdebt-threshold
Open

fix: report tech-debt changes by data-row content, not line count#45
kim-em wants to merge 1 commit into
masterfrom
fix-techdebt-threshold

Conversation

@kim-em

@kim-em kim-em commented May 27, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a regression introduced by #28 (the strong/weak split). That refactor moved the commit URLs out of report into the new reportFooter (called separately), but prSummaryReport kept its -le 5 "no changes" line-count threshold. After the split, the filtered report only carries 2 boilerplate lines (header + separator), so any PR changing three or fewer counters of a given level is silently reported as "no changes".

Example: leanprover-community/mathlib4#39932 removed one set_option backward.isDefEq.respectTransparency false in, which should have shown up as |5854|-1|backward.isDefEq.respectTransparency|, but the bot reported "No changes to strong technical debt". See https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/no.20change.20to.20technical.20debt/near/598112382.

Rather than patch the threshold — which would stay coupled to whatever incidental formatting report happens to emit and silently rot again on the next formatting tweak — this PR filters directly to non-zero data rows (in a named filterChangedRows) and branches on [ -z "${changedRows}" ]. The table header is reconstructed in the "has changes" branch. The Change column is used as the emptiness test (rather than the Current column) because a counter that disappeared entirely in the new commit renders as ||-1|name| — empty Current — and we still want to report it.

Verified locally:

  • PR #39932 (single change to an existing flag) now reports |5854|-1|backward.isDefEq.respectTransparency|.
  • A simulated PR that removes the last use of backward.inferInstanceAs.wrap.reuseSubInstances also reports it, as ||-1|backward.inferInstanceAs.wrap.reuseSubInstances|.
  • A no-op (master vs master) still reports "No changes to strong technical debt" / "No changes to weak technical debt".

🤖 Prepared with Claude Code

Previously `prSummaryReport` decided whether to render a report by
counting lines in the rendered text:

  if [ "$(wc -l <<<"${rep}")" -le 5 ]; then "no changes"

That worked in the original layout (mathlib4#18971) where `report`
emitted 5 boilerplate lines (header + separator + blank + 2 commit
URLs). When the strong/weak split (#28) moved the commit URLs into a
separate `reportFooter`, only 2 boilerplate lines remained in `rep`,
but the `-le 5` threshold was kept. Any PR changing three or fewer
counters of a given level was silently reported as "no changes" — e.g.
leanprover-community/mathlib4#39932 removed
one `set_option backward.isDefEq.respectTransparency false in` without
the bot noticing.

Instead of patching the threshold (which would stay coupled to whatever
incidental formatting `report` happens to emit), filter directly to the
non-zero data rows in a named `filterChangedRows`, branch on
`[ -z "${changedRows}" ]`, and reconstruct the table header in the
"has changes" branch. The Change column is used as the test (rather
than the Current column) because a counter that disappeared entirely
in the new commit renders as `||-1|name|` — empty Current — and we
still want to report it.

🤖 Prepared with Claude Code
@kim-em kim-em force-pushed the fix-techdebt-threshold branch from d07c443 to 347aa1d Compare May 27, 2026 15:39
@kim-em kim-em changed the title fix: lower tech-debt "no changes" threshold to 2 lines fix: report tech-debt changes by data-row content, not line count May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant